#coding=utf-8
import urllib
import time
import threading
def hit():
    while True:
                page = urllib.urlopen(web)
                code =page.getcode()
                if code==502:
                        time.sleep(intime)
                elif code!=200:
                        print "Error!"+str(code)
                else:
                        html = page.read()	
t=[]
print "Please input thread numbers!"
a=input()
print "Please input webaddress(like:https://www.baidu.com/)"
web=raw_input()
print "Please input how long you want to delay"
intime=input()
b=0
while b!=a:
	t.append(threading.Thread(target=hit))
	t[b].start()
	b=b+1